Optimal. Leaf size=127 \[ \frac{a b d \text{PolyLog}\left (2,-e^{2 (e+f x)}\right )}{f^2}+\frac{a^2 (c+d x)^2}{2 d}+\frac{2 a b (c+d x) \log \left (e^{2 (e+f x)}+1\right )}{f}-\frac{a b (c+d x)^2}{d}-\frac{b^2 (c+d x) \tanh (e+f x)}{f}+b^2 c x+\frac{b^2 d \log (\cosh (e+f x))}{f^2}+\frac{1}{2} b^2 d x^2 \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.182964, antiderivative size = 127, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.389, Rules used = {3722, 3718, 2190, 2279, 2391, 3720, 3475} \[ \frac{a b d \text{PolyLog}\left (2,-e^{2 (e+f x)}\right )}{f^2}+\frac{a^2 (c+d x)^2}{2 d}+\frac{2 a b (c+d x) \log \left (e^{2 (e+f x)}+1\right )}{f}-\frac{a b (c+d x)^2}{d}-\frac{b^2 (c+d x) \tanh (e+f x)}{f}+b^2 c x+\frac{b^2 d \log (\cosh (e+f x))}{f^2}+\frac{1}{2} b^2 d x^2 \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3722
Rule 3718
Rule 2190
Rule 2279
Rule 2391
Rule 3720
Rule 3475
Rubi steps
\begin{align*} \int (c+d x) (a+b \tanh (e+f x))^2 \, dx &=\int \left (a^2 (c+d x)+2 a b (c+d x) \tanh (e+f x)+b^2 (c+d x) \tanh ^2(e+f x)\right ) \, dx\\ &=\frac{a^2 (c+d x)^2}{2 d}+(2 a b) \int (c+d x) \tanh (e+f x) \, dx+b^2 \int (c+d x) \tanh ^2(e+f x) \, dx\\ &=\frac{a^2 (c+d x)^2}{2 d}-\frac{a b (c+d x)^2}{d}-\frac{b^2 (c+d x) \tanh (e+f x)}{f}+(4 a b) \int \frac{e^{2 (e+f x)} (c+d x)}{1+e^{2 (e+f x)}} \, dx+b^2 \int (c+d x) \, dx+\frac{\left (b^2 d\right ) \int \tanh (e+f x) \, dx}{f}\\ &=b^2 c x+\frac{1}{2} b^2 d x^2+\frac{a^2 (c+d x)^2}{2 d}-\frac{a b (c+d x)^2}{d}+\frac{2 a b (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac{b^2 d \log (\cosh (e+f x))}{f^2}-\frac{b^2 (c+d x) \tanh (e+f x)}{f}-\frac{(2 a b d) \int \log \left (1+e^{2 (e+f x)}\right ) \, dx}{f}\\ &=b^2 c x+\frac{1}{2} b^2 d x^2+\frac{a^2 (c+d x)^2}{2 d}-\frac{a b (c+d x)^2}{d}+\frac{2 a b (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac{b^2 d \log (\cosh (e+f x))}{f^2}-\frac{b^2 (c+d x) \tanh (e+f x)}{f}-\frac{(a b d) \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 (e+f x)}\right )}{f^2}\\ &=b^2 c x+\frac{1}{2} b^2 d x^2+\frac{a^2 (c+d x)^2}{2 d}-\frac{a b (c+d x)^2}{d}+\frac{2 a b (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac{b^2 d \log (\cosh (e+f x))}{f^2}+\frac{a b d \text{Li}_2\left (-e^{2 (e+f x)}\right )}{f^2}-\frac{b^2 (c+d x) \tanh (e+f x)}{f}\\ \end{align*}
Mathematica [A] time = 1.98691, size = 192, normalized size = 1.51 \[ \frac{\cosh (e+f x) (a+b \tanh (e+f x))^2 \left (-2 a b d \cosh (e+f x) \text{PolyLog}\left (2,-e^{-2 (e+f x)}\right )+\cosh (e+f x) \left (-(e+f x) \left (a^2 (-2 c f+d e-d f x)-2 a b d (e+f x)+b^2 (-2 c f+d e-d f x)\right )+2 b \log (\cosh (e+f x)) (2 a c f-2 a d e+b d)+4 a b d (e+f x) \log \left (e^{-2 (e+f x)}+1\right )\right )-2 b^2 f (c+d x) \sinh (e+f x)\right )}{2 f^2 (a \cosh (e+f x)+b \sinh (e+f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.085, size = 221, normalized size = 1.7 \begin{align*}{\frac{{a}^{2}d{x}^{2}}{2}}-abd{x}^{2}+{\frac{{b}^{2}d{x}^{2}}{2}}+c{a}^{2}x+2\,abcx+{b}^{2}cx+2\,{\frac{{b}^{2} \left ( dx+c \right ) }{f \left ({{\rm e}^{2\,fx+2\,e}}+1 \right ) }}-2\,{\frac{{b}^{2}d\ln \left ({{\rm e}^{fx+e}} \right ) }{{f}^{2}}}+{\frac{{b}^{2}d\ln \left ({{\rm e}^{2\,fx+2\,e}}+1 \right ) }{{f}^{2}}}+2\,{\frac{abc\ln \left ({{\rm e}^{2\,fx+2\,e}}+1 \right ) }{f}}-4\,{\frac{abc\ln \left ({{\rm e}^{fx+e}} \right ) }{f}}+4\,{\frac{abde\ln \left ({{\rm e}^{fx+e}} \right ) }{{f}^{2}}}-4\,{\frac{abdex}{f}}-2\,{\frac{abd{e}^{2}}{{f}^{2}}}+2\,{\frac{b\ln \left ({{\rm e}^{2\,fx+2\,e}}+1 \right ) adx}{f}}+{\frac{bda{\it polylog} \left ( 2,-{{\rm e}^{2\,fx+2\,e}} \right ) }{{f}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{1}{2} \, a^{2} d x^{2} +{\left (x^{2} - 4 \, \int \frac{x}{e^{\left (2 \, f x + 2 \, e\right )} + 1}\,{d x}\right )} a b d + b^{2} c{\left (x + \frac{e}{f} - \frac{2}{f{\left (e^{\left (-2 \, f x - 2 \, e\right )} + 1\right )}}\right )} + a^{2} c x + \frac{1}{2} \, b^{2} d{\left (\frac{f x^{2} +{\left (f x^{2} e^{\left (2 \, e\right )} - 4 \, x e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{f e^{\left (2 \, f x + 2 \, e\right )} + f} + \frac{2 \, \log \left ({\left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )} e^{\left (-2 \, e\right )}\right )}{f^{2}}\right )} + \frac{2 \, a b c \log \left (\cosh \left (f x + e\right )\right )}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] time = 2.63085, size = 2421, normalized size = 19.06 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tanh{\left (e + f x \right )}\right )^{2} \left (c + d x\right )\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (d x + c\right )}{\left (b \tanh \left (f x + e\right ) + a\right )}^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]